﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace XYS.Core.Models
{
    /// <summary>
    /// 分页参数
    /// </summary>
    public class PageRequest
    {
        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; } = 30;

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageNo { get; set; } = 1;

        /// <summary>
        /// 是否正序排序
        /// </summary>
        public bool IsAsc { get; set; } = false;

        /// <summary>
        /// 排序字段
        /// </summary>
        public virtual string Sort { get; set; } = "id";
    }

    /// <summary>
    /// 分页参数
    /// </summary>
    public class PageRequest<T>
    {
        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; } = 30;

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageNo { get; set; } = 1;

        /// <summary>
        /// 是否正序排序
        /// </summary>
        public bool IsAsc { get; set; } = false;

        /// <summary>
        /// 排序字段
        /// </summary>
        public virtual string Sort { get; set; }

        /// <summary>
        /// 请求参数
        /// </summary>
        public T Request { get; set; }
    }



    /// <summary>
    /// 分页结果
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PageResult<T>
    {
        /// <summary>
        /// 总记录数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 数据内容
        /// </summary>
        public List<T> List { get; set; }

    }
}
